package com.blacktea.creationalpatterns.abstractfactorypattern.factory;

import com.blacktea.creationalpatterns.abstractfactorypattern.service.AliPayService;
import com.blacktea.creationalpatterns.abstractfactorypattern.service.WeChatPayService;
import org.springframework.stereotype.Service;

import java.util.Optional;

/**
 * @description:
 * @author: black tea
 * @date: 2023/3/19 14:46
 */
@Service
public class ConcretePayFactory implements AbstractPayFactory {

    @Override
    public Optional<AliPayService> createAliPay() {
        return Optional.of(new AliPayService());
    }

    @Override
    public Optional<WeChatPayService> createWxChatPay() {
        return Optional.of(new WeChatPayService());
    }
}
